<?php

namespace App\Http\Controllers;

use App\Http\Services\TrendsTopicServices;

class TrendsTopicController extends BaseController
{
    protected $trendsServices;

    public function __construct()
    {
        $this->trendsServices = new TrendsTopicServices();
    }

    /**
     * 获取动态话题
     * */
    public function getTrendsTopic()
    {
        do {
            if (!$this->checkRequest()) {
                break;
            }

            $this->callCommon($this->trendsServices, 'getTrendsTopic', $this->requestData);

        } while (false);

        $this->responseData();
    }

    /**
     * 动态话题-获取详情
     * */
    public function getTrendsTopicDetail()
    {
        do {
            if (!$this->checkRequest()) {
                break;
            }

            $this->callCommon($this->trendsServices, 'getTrendsTopicDetail', $this->requestData);

        } while (false);

        $this->responseData();
    }

    ####################################################################################################

    /**
     * 动态话题-动态参与-获取动态内容列表分页
     * */
    public function getTrendsJoinListByTopicId()
    {
        do {
            if (!$this->checkRequest()) {
                break;
            }

            $this->callCommon($this->trendsServices, 'getTrendsJoinListByTopicId', $this->requestData);

        } while (false);

        $this->responseData();
    }

    ####################################################################################################

    /**
     * 动态话题-更新或创建
     * */
    public function updateOrInsertTrendsTopic()
    {
        do {
            if (!$this->checkRequest(false)) {
                break;
            }

            $this->callCommon($this->trendsServices, 'updateOrInsertTrendsTopic', $this->requestData);

        } while (false);

        $this->responseData();
    }

    /**
     * 动态话题-删除
     * */
    public function removeTrendsTopic()
    {
        do {
            if (!$this->checkRequest(false)) {
                break;
            }

            $this->callCommon($this->trendsServices, 'removeTrendsTopic', $this->requestData);

        } while (false);

        $this->responseData();
    }
}